import re

pattern = '\d\.\d+'

s = 'May the force be with you3.11 the young skywalker2.7 dark side'
s2 = '4.10 The force power of dark side'
s3 = 'The force power of dark side'

lst = re.findall(pattern, s)
lst2 = re.findall(pattern, s2)
lst3 = re.findall(pattern, s3)

print(lst)      # ['3.11', '2.7']
print(lst2)     # ['4.10']
print(lst3)     # []


